<template>
    <div class="msg-content-group">
        <div class="msg-content">
            <div class="msg-item">
                <div class="avatar">
                    <img src="/static/images/library.jpg" alt="头像">
                </div>
                <div class="message">
                    <span class="nickname">用户名</span>
                    <span class="msg">发送的信息</span>
                </div>
                <div class="clearfix"></div>
            </div>
            <div class="msg-history-time">
                <span>2019年10月24日</span>
            </div>
            <div class="msg-item">
                <div class="avatar">
                    <img src="/static/images/library.jpg" alt="头像">
                </div>
                <div class="message">
                    <span class="nickname">用户名</span>
                    <span class="msg">发送的信息发送的信息发送发送的信息发送发送的信息发送发送的信息发送发送的信息发送发送的信息发送发送的信息发送发送的信息发送发送的信息发送发送的信息发送发送的信息发送发送的信息发送发送的信息发送发送的信息发送发送的信息发送发送的信息发送发送的信息发送</span>
                </div>
                <div class="clearfix"></div>
            </div>
            <div class="msg-item self">
                <div class="avatar">
                    <img src="/static/images/library.jpg" alt="头像">
                </div>
                <div class="message">
                    <span class="nickname">用户名</span>
                    <p class="msg">发送的信息发送的信信息发送的信息</p>
                </div>
                <div class="clearfix"></div>
            </div>
        </div>
        <div class="member-list">
            <h4>在线人数(0)</h4>
            <ul>
                <li class="online"><img class="avatar" src="/static/images/library.jpg"><span class="nickname">namenicknamenicknamenickname</span></li>
                <li class="online"><img class="avatar" src="/static/images/library.jpg"><span class="nickname">name</span></li>
                <li class="online"><img class="avatar" src="/static/images/library.jpg"><span class="nickname">name</span></li>
            </ul>
        </div>
    </div>
</template>

<script>
export default {

}
</script>

<style lang="scss">
.msg-content-group{
    height: calc(100% - 100px - 30px);
    background-color: whitesmoke;
    .msg-content{
        overflow-y: scroll;
        height: 100%;
        width: 505px;
        float: left;
        .msg-history-time{
            display: block;
            text-align: center;
            margin: 10px auto;
            color: whitesmoke;
            span{
                background: lightgrey;
                border-radius: 15px;
                padding: 0 10px 0 10px;
            }
        }
        .msg-item{
            margin-left: 10px;
            margin-right: 10px;
            margin-top: 10px;
            display: flex;
            flex-direction: row;
            flex-wrap: nowrap;
            .avatar{
                img{
                    width: 35px;
                    height: 35px;
                    border-radius: 5px;
                }
            }
            .message{
                display: block;
                margin: 5px;
                .nickname{
                    display: block;
                    font-size: 50%;
                    color: grey;
                }
                .msg{
                    display: block;
                    padding: 3px;
                    border-radius: 5px;
                    color: black;
                    background: white;
                    overflow: wrap;
                }
            }
        }
        .self{
            flex-direction: row-reverse;
            .avatar{
                text-align: right;
            }
            .message{
                text-align: right;
                .msg{
                    text-align: left;
                    background: lightgreen;
                }
            }
        }
    }
    .member-list{
        width: 150px;
        height: 100%;
        float: right;
        h4{
            font-size: 16px;
            line-height: 20px;
            background: skyblue;
        }
        ul{
            overflow-y: scroll;
            height: calc( 100% - 20px );
            font-size: 16px;
            line-height: 16px;
            li{
                color: lightgrey;
                box-sizing: border-box;
                margin-top: 5px;
                &.online{
                    color: black;
                }
                .avatar{
                    width: 16px;
                    height: 16px;
                    float: left;
                }
                .nickname{
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    display: block;
                }
            }
        }
    }
}
</style>
